var $ = require('../../common/helper.js');
Page({
	data: {
		data: []
	},
	onLoad: function (options) {

	},
	onShow: function () {
		var _this = this;
		$.get('api.php?app=cart&act=person', function (json) {
			_this.setData({
				data: json.data
			});
		});
	},
	edit: function (e) {
		var data = e.currentTarget.dataset;
		wx.navigateTo({
			url: '/pages/cart/person_edit?id=' + data.id,
		});
	},
	select: function (e) {
		var data = e.currentTarget.dataset,
			apps = $.getApps(), app = apps[apps.length - 2];
		app.setParam('person', data);
		wx.navigateBack();
	}
})